home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Shutdown FX 1.3 Source / Shutdown FX ƒ / sfx wipes ƒ / Circle serendipity.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-14  |  2.0 KB  |  74 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        Circle serendipity.c
  4.  
  5. Purpose:    This module handles clearing the screen in a funky
  6.             manner.  See the comments below for more details.
  7.             
  8.  
  9. Shutdown FX -=- graphic effects on shutdown
  10. Copyright (C) 1993 Mark Pilgrim & Dave Blumenthal
  11.  
  12. This program is free software; you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation; either version 2 of the License, or
  15. (at your option) any later version.
  16.  
  17. This program is distributed in the hope that it will be useful,
  18. but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. GNU General Public License for more details.
  21.  
  22. You should have received a copy of the GNU General Public License
  23. along with this program in a file named "GNU General Public License".
  24. If not, write to the Free Software Foundation, 675 Mass Ave,
  25. Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #include "msg timing.h"
  30.  
  31. #define    gap            7
  32. #define CorrectTime 2
  33.  
  34. void CircleSerendipity(Pattern *thePattern, int width, int height);
  35.  
  36. /* I haven't the slightest idea why this works.  Hence the name.  -MP */
  37.  
  38. void CircleSerendipity(Pattern *thePattern, int width, int height)
  39. {
  40.     Rect            theRect;
  41.     Rect            source;
  42.     RgnHandle        curregion;
  43.     Point            zeropoint;
  44.     
  45.     source.top=source.left=0;
  46.     source.right=width;
  47.     source.bottom=height;
  48.     
  49.     theRect=source;
  50.     theRect.top-=height;
  51.     OffsetRect(&theRect,0,-height);
  52.         
  53.     curregion=NewRgn();
  54.     SetEmptyRgn(curregion);
  55.     OpenRgn();
  56.         FrameOval(&theRect);
  57.     CloseRgn(curregion);
  58.     zeropoint.v=height;
  59.     zeropoint.h=0;
  60.     do
  61.     {
  62.         StartTiming();
  63.         FillRgn(curregion, *thePattern);
  64.         OffsetRgn(curregion, 0, gap);
  65.         TimeCorrection(CorrectTime);
  66.     }
  67.     while (!(PtInRgn(zeropoint, curregion)));
  68.  
  69.     SetRect(&theRect, 0, 0, width, height);
  70.     FillRect(&theRect, *thePattern);
  71.     
  72.     DisposeRgn(curregion);
  73. }
  74.